home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / bin / forum / wsNt < prev   
Text File  |  1996-11-11  |  2KB  |  73 lines

  1. #!/bin/csh
  2. #
  3. #  SNt showcase with synchronized audio playback by John Magdziarz
  4. #  SNt launch script                             by Andrew Cameron
  5. #
  6.  
  7. set there = `dirname $0`/
  8. setenv XUSERFILESEARCHPATH ${there}/%N
  9. set path = ( ${there} $path )
  10. setenv LD_LIBRARY_PATH ${there}:/usr/lib/libsNt
  11.  
  12. set complete_file=`tail -2 $argv[$#argv] | grep -c "wsNt"`
  13. if ( ${complete_file} != 1 ) then
  14.     echo "Error: Incomplete file transfer,"
  15.     echo "       check your disk space and try again."
  16.     exit 1
  17. endif
  18.  
  19. set wsnt_cnt=`tail -1 $argv[$#argv]`
  20. @  wsnt_cnt_t = $wsnt_cnt - 3
  21. @  wsnt_cnt_h = $wsnt_cnt_t - 1
  22.  
  23. set name0 = `tail -$wsnt_cnt $argv[$#argv] | head -2 | tail -1`
  24. set dir0 = `dirname $argv[$#argv]`
  25. set name = `basename $name0`
  26. #loading "Loading $name:r Audio and Showcase files takes a little time.  Please stand by..." 120
  27.  
  28. set control_file = `tail -2 $argv[$#argv] | grep -c "control"`
  29. if ( ${control_file} ) then
  30.    if ( -p /tmp/.${name}.ctl ) then
  31.       set command = `tail -3 $argv[$#argv] | head -1`
  32.       echo $command > /tmp/.${name}.ctl
  33.       #echo $command sent to  /tmp/.${name}.ctl
  34.    else
  35.       echo ${name} is not an active sNt presentation at this time.
  36.       echo To activate this presentation, use the red sNt "Presentation" icon.
  37.    endif
  38.    exit
  39. endif
  40.   
  41. set tmpfile = /usr/tmp/wsnt$$.wsnt
  42.  
  43. echo "2" > $tmpfile
  44. echo $name0 >> $tmpfile
  45. #head -3 $argv[$#argv] | tail -1 #>> $tmpfile
  46. echo $* >> $tmpfile
  47. tail -$wsnt_cnt_t $argv[$#argv] | head -$wsnt_cnt_t >> $tmpfile
  48.  
  49. if (-e /tmp/snt_debug) (xconfirm -t "Starting sNt ..." -B Dismiss &) >& /dev/null
  50. set snt_opts=""
  51. if ( -e /tmp/snt_edit ) set snt_opts="-e"
  52.  
  53. if ( $?SNT_VERBOSE ) then
  54.   (${there}/snt $snt_opts -v $tmpfile ; /bin/rm -f $tmpfile)  >&/dev/console
  55. else
  56.   (${there}/snt $snt_opts $tmpfile ; /bin/rm -f $tmpfile)  >&/dev/null 
  57. endif
  58. if ( -e ${dir0}/$name:r.wsnt ) then
  59. else
  60. if ( $argv[$#argv] != ${dir0}/$name:r.wsnt ) then
  61.   switch (`xconfirm -t "Do you want to keep this wsnt/audio file for later use?" -t " " -t "(ie. rename $argv[$#argv] to ${dir0}/$name:r.wsnt)" -B Yes -b no`)
  62.          case Yes:
  63.                mv $argv[$#argv] ${dir0}/$name:r.wsnt
  64.                ln -s ${dir0}/$name:r.wsnt $argv[$#argv]
  65.                breaksw
  66.          case No:
  67.                echo "Skipping ..."
  68.                breaksw
  69.   endsw
  70. endif
  71. endif
  72.  
  73.